package com.lb.activity.service.impl;

import com.lb.activity.mapper.RolePermissionMapper;
import com.lb.activity.po.RolePermission;
import com.lb.activity.service.RolePermissionService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author liubin
 */
@Service
public class RolePermissionServiceImpl implements RolePermissionService {

    @Resource
    private RolePermissionMapper rolePermissionMapper;

    @Override
    public List<RolePermission> getRolePermissions(Long roleid) {
        Example example = new Example(RolePermission.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("roleid",roleid);
        List<RolePermission> storeRolePermissions = rolePermissionMapper.selectByExample(example);
        return storeRolePermissions;
    }

}
